Update OpenApi implementation to avoid reflection#1185
Conversation
a8d358d to
53e1275
Compare
53e1275 to
0a59d0b
Compare
0a59d0b to
bde8d62
Compare
| <OpenApiGenerateDocuments>false</OpenApiGenerateDocuments> | ||
| <OpenApiGenerateDocumentsOnBuild>false</OpenApiGenerateDocumentsOnBuild> |
There was a problem hiding this comment.
In case build-time generation was previously broken already (which I would expect it to), then the package should set these by default.
There was a problem hiding this comment.
This was definitely working before
There was a problem hiding this comment.
Good to know. I'll continue investigations then.
There was a problem hiding this comment.
Indeed. I updated PR description. It's working already on main and I'll try to look how can I make it work with the changes in this PR.
|
Build-time generation does work. The example OpenAPI projects have this enabled and will generate the document on build. If you find this not to be the case and can provide some more details, I can help troubleshoot. |
|
Can you please validate with the latest changes how well the implementation here works? And whether the implementation is satisfying and looks good to you? |
6c71497 to
c8851a1
Compare
c8851a1 to
888f90e
Compare
| semaphore.Wait(); | ||
| try | ||
| { | ||
| if ( initialized || !isReady ) |
| if ( descriptor.ServiceType.FullName == "Microsoft.Extensions.ApiDescriptions.IDocumentProvider" ) | ||
| { | ||
| return descriptor; | ||
| } |
| { | ||
| return descriptor; | ||
| } | ||
| } | ||
|
|
||
| if ( GetJsonConfiguration() is { } descriptor ) | ||
| throw new UnreachableException(); | ||
| } |
There was a problem hiding this comment.
@Youssef1313 Overall, it's looking solid to me. I'll see if I can't pull down these changes and test it out tonight. Thanks for the assist.
f520deb to
b492d06
Compare
|
Looks like I broke build-time generation while fixing some test failure. Things feel so fragile so far. |
|
Yeah ... these things can be yucky. I appreciate the assist. Let me know if there's anything you need. |
|
Replaced with #1186 Attempting to replace service provider or doing anything similar is extremely fragile. |
No description provided.